<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ClienteLoginTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>

            <h:panelGrid id="lpg" columns="2">
                <h:form >
                    <h:panelGrid id="lpg1" columns="2">
                        <h:outputText value="Si ya es cliente, introduzca:"/>
                        <h:outputText value=""/>
                        <h:outputLabel value="#{bundle.CreateClienteLabel_email}" for="email" />
                        <h:inputText id="email" value="#{clienteController.selected.email}" title="#{bundle.CreateClienteTitle_email}" required="true" requiredMessage="#{bundle.CreateClienteRequiredMessage_email}"/>
                        <h:outputLabel value="#{bundle.CreateUsuarioLabel_clave}" for="clave" />
                        <h:inputSecret id="clave" value="#{clienteController.selected.clave}" title="#{bundle.CreateClienteTitle_clave}" required="true" requiredMessage="#{bundle.CreateClienteRequiredMessage_clave}"/>
                        <h:commandButton action="#{clienteController.login}" value="#{bundle.UserLoginLink}" id="loginButton" />
                    </h:panelGrid>
                </h:form>
                <h:form>
                    <h:panelGrid id="lpg2" columns="2">
                        <h:outputText value="Es un nuevo cliente?"/>
                        <h:outputText value=""/>
                        <h:outputLabel value="#{bundle.CreateClienteLabel_email}" for="email" />
                        <h:inputText id="email" value="#{clienteController.selected.email}" title="#{bundle.CreateClienteTitle_email}" required="true" requiredMessage="#{bundle.CreateClienteRequiredMessage_email}"/>
                        <h:commandButton action="/cliente/Create" value="#{bundle.ClienteCreateLink}" id="loginButton" />
                    </h:panelGrid>
                </h:form>
            </h:panelGrid>

            <br/>
            <h:form>
                <h:commandLink value="#{bundle.ListPedidoIndexLink}" action="/index" immediate="true" />
            </h:form>

        </ui:define>
    </ui:composition>

</html>